<!DOCTYPE HTML>
<html>
	<head>
	</head>
	<body>
		<script type="text/javascript">
				//test execution context and scope chain
				//1 type
				/*
				function supFunction(){
					var supVar = 'a';
					subFunction();
				}
				function subFunction(){
					var subVar = 'b';
					alert(supVar); //supVar undefined
					alert(subVar);
				}
				supFunction();
				//2 type
				function supFunction(){
					var supVar = 'a';
					function subFunction(){
						var subVar = 'b';
						alert(supVar);
						alert(subVar);
					}
					subFunction();
				}
				supFunction();
				*/
		</script>
	</body>	
</html>